#include <iostream>
#include <string>
#include <signal.h>

int main(int argc, char* argv[])
{
    if(argc != 3)
    {
        std::cout << "Usage: ./mykill signum processid" << std::endl;
        return EXIT_FAILURE;
    }
    int signum = std::stoi(argv[1]);
    int target = std::stoi(argv[2]);
    int n = kill(target, signum);
    if(n == 0)
    {
        std::cout << "signal" << signum << " has been sent to " << target << std::endl;
        return EXIT_SUCCESS;
    }
    else
    {
        std::cout << "signal sent failed" << std::endl;
        return EXIT_FAILURE;
    }

    return 0;
}